package com.googlecode.likesql.dml;

import com.googlecode.likesql.SeriallLikeSql;
import com.googlecode.likesql.constant.Keyword;
import com.googlecode.likesql.context.SerialSqlContext;

/**
 * Order by clause.
 * @author Johny
 *
 */
public class OrderBy  extends SeriallLikeSql {

	public OrderBy(SerialSqlContext context) {
		super(context);
	}
	
	/**
	 * order by column1,column2...
	 * 
	 * @param columns
	 * @return
	 */
	public OrderBy orderBy(String columns){
		context.appendSP(Keyword.ORDER_BY).appendSP(columns);
		return this;
	}
	
	/**
	 * asc
	 * 
	 * @return
	 */
	public OrderBy asc() {
		context.appendSP(Keyword.ASC);
		return this;
	}

	/**
	 * desc
	 * 
	 * @return
	 */
	public OrderBy desc() {
		context.appendSP(Keyword.DESC);
		return this;
	}

}
